home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
OCEStandardDirectory.p
< prev
next >
Wrap
Text File
|
1995-09-14
|
19KB
|
613 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 8:35:11 PM }
{}
{ File: OCEStandardDirectory.p}
{ }
{ Contains: Apple Open Collaboration Environment Standard Directory Interfaces.}
{ }
{ Version: Technology: AOCE Toolbox 1.02}
{ Package: Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
{ }
{ Copyright: © 1984-1995 by Apple Computer, Inc.}
{ All rights reserved.}
{ }
{ Bugs?: If you find a problem with this file, use the Apple Bug Reporter}
{ stack. Include the file and version information (from above)}
{ in the problem description and send to:}
{ Internet: apple.bugs@applelink.apple.com}
{ AppleLink: APPLE.BUGS}
{ }
{}
unit OCEStandardDirectory;
interface
{$IFC UNDEFINED __OCESTANDARDDIRECTORY__}
{$SETC __OCESTANDARDDIRECTORY__ := 1}
uses
ConditionalMacros, Types, AppleTalk, Processes, PPCToolbox, Notification, EPPC, Files, Aliases, AppleEvents, Icons, Quickdraw, Controls, Windows, OCE, OCEAuthDir;
{ $PUSH}
{ $ALIGN MAC68K}
{ $LibExport+}
const
gestaltSDPStandardDirectoryVersion = 'sdvr';
gestaltSDPFindVersion = 'dfnd';
gestaltSDPPromptVersion = 'prpv';
genericDirectoryIconResource = -16721; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
genericLockedDirectoryIconResource = -16716; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
genericRecordIconResource = -16722; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
genericAttributeIconResource = -16723; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
genericTemplateIconResource = -16746; { icl8, icl4, ICN#, ics#, ics4, ics8 }
{ standard icon suites }
directoryFolderIconResource = -16720; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
lockedDirectoryFolderIconResource = -16719; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
personalDirectoryIconResource = -16718; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
directoriesIconResource = -16717; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
preferredPersonalDirectoryIconResource = -16724; { icl8, icl4, ICN#, ics#, ics4, ics8, sicn }
{ icon IDs for spinning arrows }
kFirstSpinnerIcon = -16745;
kLastSpinnerIcon = -16738;
{ resource types }
kSDPPanelResourceType = 'panl';
kSDPFindPanelResourceType = 'find';
{ Standard FindPanel resource }
kStandardFindLayout = -16700;
{ Prompt For Identity structures }
kSDPGuestBit = 0;
kSDPSpecificIdentityBit = 1;
kSDPLocalIdentityBit = 2;
{ Values of SDPIdentityKind }
kSDPGuestMask = $1;
kSDPSpecificIdentityMask = $2;
kSDPLocalIdentityMask = $4;
type
SDPIdentityKind = INTEGER;
const
kSDPSuggestionOnly = 0;
kSDPRestrictToDirectory = 1;
kSDPRestrictToRecord = 2;
type
SDPLoginFilterKind = INTEGER;
{ Panel Structures }
{}
{While the panel is in operation, four selection states may exist.}
{ 1) kSDPNothingSelected means nothing is selected.}
{ 2) kContainSelected means a volume, folder, catalog, dnode, or PAB is selected.}
{ 3) kSDPLockedContainerSelected means one of the above, but no access privledges.}
{ 4) kSDPRecordSelected means that a record is currently selected.}
{}
{ Values of SDPSelectionState }
const
kSDPNothingSelected = 0;
kSDPLockedContainerSelected = 1;
kSDPContainerSelected = 2;
kSDPRecordSelected = 3;
kSDPRecordAliasSelected = 4;
kSDPContainerAliasSelected = 5;
type
SDPSelectionState = INTEGER;
{}
{This type informs the caller of the action the user took, either as the result}
{of an event (as returned by SDPPanelEvent) or when SDPOpenSelectedItem is called.}
{}
{kSDPProcessed means that the event (or call to SDPOpenSelectedItem) resulted in no}
{state change.}
{}
{kSDPSelectedAnItem indicates that the user wants to select the currently-hilited}
{record. This is returned, for example, when a user double-clicks on a record.}
{}
{kSDPChangedSelection implies that the user clicked on a new item (which may mean}
{that no item is selected).}
{}
{ Values of SDPPanelState }
const
kSDPProcessed = 0;
kSDPSelectedAnItem = 1;
kSDPChangedSelection = 2;
type
SDPPanelState = INTEGER;
{}
{Your application may read any of the fields in a SDPPanelRecord, but it should}
{use the appropriate routines to make changes to the records with the exception}
{of the refCon field which your application may read or write at will. Private}
{information follows the SDPPanelRecord, so the handle must not be re-sized.}
{}
SDPPanelRecord = record
bounds: Rect;
visible: BOOLEAN;
enabled: BOOLEAN;
focused: BOOLEAN;
padByte: SInt8; { Byte }
identity: AuthIdentity;
refCon: LONGINT;
listRect: Rect;
popupRect: Rect;
numberOfRows: INTEGER;
rowHeight: INTEGER;
pabMode: BOOLEAN;
filler1: BOOLEAN;
end;
SDPPanelPtr = ^SDPPanelRecord;
SDPPanelHandle = ^SDPPanelPtr;
PanelBusyProcPtr = ProcPtr; { PROCEDURE PanelBusy(Panel: SDPPanelHandle; busy: BOOLEAN); }
PanelBusyUPP = UniversalProcPtr;
const
uppPanelBusyProcInfo = $000001C0; { PROCEDURE (4 byte param, 1 byte param); }
function NewPanelBusyProc (userRoutine: PanelBusyProcPtr): PanelBusyUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
procedure CallPanelBusyProc (Panel: SDPPanelHandle; busy: BOOLEAN; userRoutine: PanelBusyUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
type
PanelBusyProc = PanelBusyUPP;
{ Find Panel Structures }
const
kSDPItemIsSelectedBit = 0;
kSDPFindTextExistsBit = 1;
{ Values of SDPFindPanelState }
kSDPItemIsSelectedMask = $1;
kSDPFindTextExistsMask = $2;
type
SDPFindPanelState = INTEGER;
{ Values of SDPFindPanelFocus }
const
kSDPFindPanelNoFocus = 0;
kSDPFindPanelListHasFocus = 1;
kSDPFindPanelTextHasFocus = 2;
type
SDPFindPanelFocus = INTEGER;
SDPFindPanelRecord = record
upperLeft: Point;
visible: BOOLEAN;
enabled: BOOLEAN;
nowFinding: BOOLEAN;
padByte: SInt8; { Byte }
currentFocus: SDPFindPanelFocus;
identity: AuthIdentity;
simultaneousSearchCount: INTEGER;
refCon: LONGINT;
end;
SDPFindPanelPtr = ^SDPFindPanelRecord;
SDPFindPanelHandle = ^SDPFindPanelPtr;
{ Values of SDPFindPanelResult }
const
kSDPSelectedAFindItem = 0;
kSDPFindSelectionChanged = 1;
kSDPFindCompleted = 2;
kSDPTextStateChanged = 3;
kSDPFocusChanged = 4;
kSDPSelectionAndFocusChanged = 5;
kSDPMenuChanged = 6;
kSDPSelectionAndMenuChanged = 7;
kSDPProcessedFind = 8;
type
SDPFindPanelResult = INTEGER;
PackedRStringListHandle = ^PackedPathNamePtr;
PackedDSSpecHandle = ^PackedDSSpecPtr;
FindPanelBusyProcPtr = ProcPtr; { PROCEDURE FindPanelBusy(findPanel: SDPFindPanelHandle; busy: BOOLEAN); }
FindPanelBusyUPP = UniversalProcPtr;
const
uppFindPanelBusyProcInfo = $000001C0; { PROCEDURE (4 byte param, 1 byte param); }
function NewFindPanelBusyProc (userRoutine: FindPanelBusyProcPtr): FindPanelBusyUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
procedure CallFindPanelBusyProc (findPanel: SDPFindPanelHandle; busy: BOOLEAN; userRoutine: FindPanelBusyUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
type
FindPanelBusyProc = FindPanelBusyUPP;
{ Prompt For Identity Routines }
function SDPPromptForID (var id: AuthIdentity; guestPrompt: ConstStr255Param; specificIDPrompt: ConstStr255Param; localIDPrompt: ConstStr255Param; {CONST}
var recordType: RString; permittedKinds: SDPIdentityKind; var selectedKind: SDPIdentityKind; {CONST}
var loginFilter: RecordID; filterKind: SDPLoginFilterKind): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 16, 904, $AA5D;
{$ENDC}
{}
{SDPNewPanel creates a new panel. You supply the window in which the panel}
{is to live, the bounds for the panel (which includes both the menu and the list),}
{whether or not the panel is to be initially visible, the initial RLI (nil for}
{catalogs and volumes), the types of records that will be shown (only a single}
{(non-nil) type which may contain wildcards), the identity by which to browse}
{(for access control reasons), and a refCon which is available to the caller.}
{}
function SDPNewPanel (var newPanel: SDPPanelHandle; window: WindowPtr; {CONST}
var bounds: Rect; visible: BOOLEAN; enabled: BOOLEAN; {CONST}
var initialRLI: PackedRLI; {CONST}
var typesList: RStringPtr; typeCount: LONGINT; identity: AuthIdentity; enumFlags: DirEnumChoices; matchTypeHow: ByteParameter; refCon: LONGINT): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 21, 100, $AA5D;
{$ENDC}
{}
{SDPSetIdentity Sets the identity used for browsing. NOTE: This call is likely to go}
{away if the new authentication scheme works.}
{}
function SDPSetIdentity (panel: SDPPanelHandle; identity: AuthIdentity): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 115, $AA5D;
{$ENDC}
{}
{SDPGetNewPanel is similar to SDPNewPanel above, except it takes a resource id of a}
{'panl' resource.}
{}
function SDPGetNewPanel (var newPanel: SDPPanelHandle; resourceID: INTEGER; window: WindowPtr; {CONST}
var initialRLI: PackedRLI; identity: AuthIdentity): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 9, 101, $AA5D;
{$ENDC}
{}
{Call this when you're completely done with a panel. It deallocates all of the}
{associated data structures.}
{}
function SDPDisposePanel (panel: SDPPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 102, $AA5D;
{$ENDC}
{}
{If the panel is visible, it makes it invisible by hiding the menu, turning off}
{drawing of the list, and erasing and invaling the list's rectangle.}
{}
function SDPHidePanel (panel: SDPPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 103, $AA5D;
{$ENDC}
{ If the panel is invisible, it makes it visible and draws it. }
function SDPShowPanel (panel: SDPPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 104, $AA5D;
{$ENDC}
{ Disables the list and menu so that it won't accept any commands. }
function SDPEnablePanel (panel: SDPPanelHandle; enable: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 105, $AA5D;
{$ENDC}
{}
{Move the upper-left-hand corner of the panel to (h,v), given in local coordinates of}
{the panel's window.}
{}
function SDPMovePanel (panel: SDPPanelHandle; h: INTEGER; v: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 107, $AA5D;
{$ENDC}
{}
{Resizes the panel to have the given width and height (keeping the upper-left-hand}
{corner in a fixed position).}
{}
function SDPSizePanel (panel: SDPPanelHandle; width: INTEGER; height: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 108, $AA5D;
{$ENDC}
{}
{This routine simulates a double-click on the selected item (if there is no selected}
{item, then it does nothing), and it returns the result of that "double-click" via the}
{whatHappened parameter. If a container is selected, then that container will be}
{opened and kMovedDownTheHierarchy is returned. If, however, the user is at the lowest}
{level in the hierarchy, then kSDPSelectedAnItem is returned.}
{}
function SDPOpenSelectedItem (panel: SDPPanelHandle; var whatHappened: SDPPanelState): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 109, $AA5D;
{$ENDC}
{}
{Returns whether a record is selected, something else is selected, or nothing is}
{selected.}
{}
function SDPGetPanelSelectionState (panel: SDPPanelHandle; var itsState: SDPSelectionState): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 110, $AA5D;
{$ENDC}
{}
{Returns the size of the currently-selected DSSpec, or zero if a record is}
{not selected. It is safe to do a NewPtr (SDPGetPanelSelectionSize (...))}
{}
function SDPGetPanelSelectionSize (panel: SDPPanelHandle; var dsSpecSize: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 114, $AA5D;
{$ENDC}
{}
{Returns the currently-selected DSSpec, or a zero-lengthed}
{DSSpec if a record is not selected. It is assumed that the selection}
{buffer allocated is large enough.}
{}
function SDPGetPanelSelection (panel: SDPPanelHandle; var selection: PackedDSSpec): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 111, $AA5D;
{$ENDC}
{}
{Forces browsing to the specified RLI. If prli is the current RLI, then it does}
{nothing.}
{}
function SDPSetPath (panel: SDPPanelHandle; {CONST}
var prli: PackedRLI): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 112, $AA5D;
{$ENDC}
{}
{This is the main driver for the panel. You should pass all events to SDPPanelEvent}
{including NULL events. If you have more than 1 panel, you will need to}
{call SDPPanelEvent for each panel. NOTE: For Update Events you will also need to call}
{SDPUpdatePanel as described below.}
{}
function SDPPanelEvent (panel: SDPPanelHandle; {CONST}
var theEvent: EventRecord; var whatHappened: SDPPanelState): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 6, 113, $AA5D;
{$ENDC}
{}
{SDPUpdatePanel should be called in response to an update event. Generally you will}
{have first called BeginUpdate, and pass the windows visRgn as theRgn. If NULL}
{is passed for theRgn the entire panel is re-drawn. NOTE: Drawing is not cliped to}
{theRgn, if this is desired, you must first call SetClip.}
{}
function SDPUpdatePanel (panel: SDPPanelHandle; theRgn: RgnHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 106, $AA5D;
{$ENDC}
{}
{SDPSelectString scrolls and selects the closest matching string at the current}
{level. This is the same behavior as if the user typed in the given string.}
{}
function SDPSelectString (panel: SDPPanelHandle; {CONST}
var name: RString): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 116, $AA5D;
{$ENDC}
{}
{SDPGetPathLength returns the length in bytes required to hold the current path name}
{in RLI format. This corresponds to the path name in the popup menu.}
{}
function SDPGetPathLength (panel: SDPPanelHandle; var pathNameLength: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 117, $AA5D;
{$ENDC}
{ SDPGetPath returns the current rli. }
function SDPGetPath (panel: SDPPanelHandle; var prli: PackedRLI; var dsRefNum: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 6, 118, $AA5D;
{$ENDC}
{}
{SDPSetFocus will draw the focus rectangle or erase the focus rectangle depending upon}
{the focus boolean.}
{}
function SDPSetFocus (panel: SDPPanelHandle; focus: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 119, $AA5D;
{$ENDC}
{}
{SDPSetPanelBalloonHelp allows clients to specify a STR# resource id to use for }
{balloon help. Balloon help is unavailable until this call is made.}
{}
function SDPSetPanelBalloonHelp (panel: SDPPanelHandle; balloonHelpID: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 120, $AA5D;
{$ENDC}
{}
{SDPInstallPanelBusyProc allows clients to install a CB that will be called while}
{the panel is aynchronously busy.}
{}
function SDPInstallPanelBusyProc (panel: SDPPanelHandle; busyProc: PanelBusyProc): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 121, $AA5D;
{$ENDC}
function SDPNewFindPanel (var newPanel: SDPFindPanelHandle; window: WindowPtr; upperLeft: Point; layoutResourceID: INTEGER; visible: BOOLEAN; enabled: BOOLEAN; {CONST}
var typesList: RStringPtr; typeCount: LONGINT; matchTypeHow: ByteParameter; identity: AuthIdentity; simultaneousSearchCount: INTEGER; initialFocus: SDPFindPanelFocus; refCon: LONGINT): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 20, 2300, $AA5D;
{$ENDC}
function SDPDisposeFindPanel (findPanel: SDPFindPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 2301, $AA5D;
{$ENDC}
function SDPStartFind (findPanel: SDPFindPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 2302, $AA5D;
{$ENDC}
function SDPStopFind (findPanel: SDPFindPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 2303, $AA5D;
{$ENDC}
function SDPFindPanelEvent (findPanel: SDPFindPanelHandle; {CONST}
var event: EventRecord; var whatHappened: SDPFindPanelResult): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 6, 2304, $AA5D;
{$ENDC}
function SDPUpdateFindPanel (findPanel: SDPFindPanelHandle; theRgn: RgnHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2305, $AA5D;
{$ENDC}
function SDPShowFindPanel (findPanel: SDPFindPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 2306, $AA5D;
{$ENDC}
function SDPHideFindPanel (findPanel: SDPFindPanelHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 2, 2307, $AA5D;
{$ENDC}
function SDPMoveFindPanel (findPanel: SDPFindPanelHandle; h: INTEGER; v: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2308, $AA5D;
{$ENDC}
function SDPEnableFindPanel (findPanel: SDPFindPanelHandle; enabled: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 2309, $AA5D;
{$ENDC}
function SDPSetFindPanelFocus (findPanel: SDPFindPanelHandle; newFocus: SDPFindPanelFocus): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 2310, $AA5D;
{$ENDC}
function SDPGetFindPanelState (findPanel: SDPFindPanelHandle; var itsState: SDPFindPanelState): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2311, $AA5D;
{$ENDC}
function SDPGetFindPanelSelectionSize (findPanel: SDPFindPanelHandle; var size: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2312, $AA5D;
{$ENDC}
function SDPGetFindPanelSelection (findPanel: SDPFindPanelHandle; var selection: PackedDSSpec): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2313, $AA5D;
{$ENDC}
function SDPSetFindPanelBalloonHelp (findPanel: SDPFindPanelHandle; balloonHelpID: INTEGER): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 2314, $AA5D;
{$ENDC}
function SDPSetFindIdentity (findPanel: SDPFindPanelHandle; identity: AuthIdentity): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2315, $AA5D;
{$ENDC}
function SDPInstallFindPanelBusyProc (findPanel: SDPFindPanelHandle; busyProc: FindPanelBusyProc): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 4, 2316, $AA5D;
{$ENDC}
function SDPGetIconByType ({CONST}
var recordType: RString; whichIcons: IconSelectorValue; var iconSuite: Handle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$303C, 1024, $AA5C;
{$ENDC}
function SDPGetDSSpecIcon ({CONST}
var packed_DSSpec: PackedDSSpec; whichIcons: IconSelectorValue; var iconSuite: Handle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$303C, 1025, $AA5C;
{$ENDC}
function SDPGetCategories (var categories: PackedRStringListHandle; var displayNames: PackedRStringListHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$303C, 1026, $AA5C;
{$ENDC}
function SDPGetCategoryTypes ({CONST}
var category: RString; var types: PackedRStringListHandle): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$303C, 1027, $AA5C;
{$ENDC}
function SDPResolveAliasFile (fileSpec: FSSpecPtr; resolvedDSSpec: PackedDSSpecHandle; identity: AuthIdentity; mayPromptUser: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 7, 3700, $AA5D;
{$ENDC}
function SDPResolveAliasDSSpec (theAliasDSSpec: PackedDSSpecHandle; identity: AuthIdentity; mayPromptUser: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 5, 3701, $AA5D;
{$ENDC}
function SDPRepairPersonalDirectory (var pd: FSSpec; showProgress: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$203C, 3, 6700, $AA5D;
{$ENDC}
{ $ALIGN RESET}
{ $POP}
{$ENDC}
{__OCESTANDARDDIRECTORY__}
implementation
end.